﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Neotic.DataAccess.Sql
{
    public class OrderClauseColumn
    {
        protected OrderClauseColumn() { } 
        
        internal OrderClauseColumn(ISelectColumn c, bool asc)
        {
            this.Column = c;
            this.Ascending = asc;
        }

        public ISelectColumn Column { get; protected set; }
        public bool Ascending { get; protected set; }

        public string ToSql()
        {
            return string.Concat(Column.AliasName, (Ascending) ? " ASC" : " DESC"); 
        }
    }
}
